home *** CD-ROM | disk | FTP | other *** search
/ The Macintosh Bible Guide to Games / GameGuideCd.bin / Cheaters / Marathon Stuff / Pfhorte_1.0d22ƒ / scripting notes < prev    next >
Text File  |  1995-08-07  |  7KB  |  174 lines

  1. Notes on Pfhorte 1.0d22 scripting system.
  2. By Steve Israelson
  3.  
  4.  
  5. Description
  6.  
  7. Script files must be stored in the folder called "Scripts", in the same folder as Pfhorte.  Any script file name starting with "#" will not appear in the scripting menu.  This allows you to have scripts that are only meant to be called by other scripts private.  Scripts are stored as text files with one script command per line.  All script commands and variables are case sensitive, so be sure to check your spelling.
  8.  
  9. To execute a script, you must have a line selected.  The Pen is positioned at the first point on this line and its angle is set to point to the second point.
  10.  
  11. There are several variables available to be examined and changed by the scripts.  These variables affect the way polygons are created, among other things.  There are some general purpose variables that you can use for your own purposes.  The scripting commands will be divided up into flow control commands, and general commands.
  12.  
  13. Look at the scripts that come with Pfhorte for an example of how to write them.  Please note that this scripting system has been entirely re-done, so there are sure to be bugs, so be careful and report them to me.
  14.  
  15. Flow Control Commands
  16.  
  17. If (booleanExpression), Else, Endif
  18. These commands allow you to have conditional execution of your scripts.  If the booleanExpression in the If statement evaluates to true, then the statements between the If and the Else will be executed, otherwise the statements between the Else and the Endif will be executed.  The Else statement is optional.
  19.  
  20. While (booleanExpression), EndWhile
  21. These statements allow you to perform a series of operations over and over until the booleanExpression is false.  While the booleanExpression is true, the statements between the While and EndWhile are executed.
  22.  
  23. Repeat, Until (booleanExpression)
  24. These statements allow you to perform a series of operations over and over until the booleanExpression is true.  While the booleanExpression is false, the statements between the Repeat and Until are executed.
  25.  
  26. Gosub name, Subroutine name, EndSub
  27. These statements allow you to group othen executed scripting commands into one command.  Whenever the Gosub name command is executed, the statements between the matching Subroutine name and the EndSub are executed.  Note that "name" can be anything you desire.
  28.  
  29. booleanExpression
  30. A boolean expresion consists of a numericalExpression, a conditional operation, and another numericalExpression.  The numericalExpression can be a number or any variable.  The conditional operations are <, <=, =, !=, >=, >, which mean less than, less than or equal to, equal to, not equal to, greater than or equal to, and greater than.
  31.  
  32.  
  33. General Commands
  34.  
  35. Here are the commands.  "n" represents a numericalExpression.
  36.  
  37. splitLine
  38.      Splits the current line in half.  The current line is set to the first half.
  39. segmentLine n    
  40.      Adds an n sized segment to the center of the current line.  Becomes the current line.
  41. turn n            
  42.      Turns the pen by n degrees.
  43. newLine n        
  44.      Creates a new line from the current point n units long.
  45. closePoly        
  46.      Creates a new line from the current point to the first point in the poly.
  47. height n        
  48.      Sets the ceiling height to the floor height plus n.
  49. ceilingHeight n    
  50.      Changes the ceiling height by n units.
  51. floorHeight n    
  52.      Changes the floor height by n units.
  53. ceilingMode n    
  54.      Sets the default ceiling draw mode to n.
  55. floorMode n        
  56.      Sets the default floor draw mode to n.
  57. polyType n        
  58.      Sets the default polygon type to n.
  59. wallType n        
  60.      Sets the wall type for the next wall to n. This is for control panels.
  61. wallMode n        
  62.      Sets the default wall draw mode to n.
  63. pushPen            
  64.      Saves the current pen position and angle.
  65. popPen            
  66.      Returns to the last saved pen position and angle.
  67. pushLine        
  68.      Saves the current line.
  69. popLine            
  70.      Returns to the last saved line and makes it the selected line.  
  71.                  ClosePoly must have been called first.  Also makes a point at the first point.
  72. move n            
  73.      Moves the pen without creating a side.
  74. makeLine        
  75.      Creates a new side from the last point to the current pen position.
  76. *                
  77.      The rest of the line is ignored.
  78. firstPoint        
  79.      Moves the pen to the first point on the selected line.
  80. lastPoint        
  81.      Moves the pen to the last point on the selected line.
  82. set variableName n
  83.      Sets the variable specified to the value of n.
  84. add variableName n
  85.      Adds n to the specified variable.
  86. divide variableName n
  87.      Divides the specified variable by n.
  88. multiply variableName n
  89.      Multiplys the specified variable by n.
  90. Debug 0 or 1
  91.      If debug is set to 1, then each line of script that is executed is written to the file "Script Output".
  92.      You can set debug to 0 to stop the output of debug info.
  93. Call fileName
  94.      This will execute all the commands in the script file specified.
  95. AskUser text
  96.      This will display a dialog with the specified text in it allowing the user to enter a number.
  97.      The number will be stored in the variable "Result".
  98.  
  99.  
  100. numericalExpressions
  101.  
  102. Numerical expressions can be a number or a variable name with an optional leading '-' to indicate a negative number or variable.  You can use these variables anywhere a number is expected.  In most cases, you can also set these variables.
  103.  
  104. LineLength
  105.      The length of the selected line.
  106. StairSize
  107.      The value for the step size in the defaults palette.
  108. LeftSize
  109.      The value for the left size in the defaults palette.
  110. RightSize
  111.      The value for the right size in the defaults palette.
  112. OrigLineLength
  113.      The length of the selected line when the user first caused this script to execute.
  114. OrigAngle
  115.      The angle of the pen when the user first caused this script to execute.
  116. OrigFloorHeight
  117.      The floor height of the poly when the user first caused this script to execute.
  118. OrigCeilingHeight
  119.      The ceiling height of the poly when the user first caused this script to execute.
  120. Angle
  121.      The current angle of the pen.
  122. DefaultFloorHeight
  123.      The floor height in the defaults palette.
  124. DefaultCeilingHeight
  125.      The ceiling height in the defaults palette.
  126. FloorHeight
  127.      The height of the floor for the next poly created.
  128. CeilingHeight
  129.      The height of the ceiling for the next poly created.
  130. Random n
  131.      A random number between 0 and n - 1.
  132. Result
  133.      The value the user entered in the AskUser dialog box.
  134. A, B, C, D
  135.      These are general purpose variables for your own use.
  136.  
  137.  
  138. Special Numerical Values
  139.  
  140. These values are only useful in special cases, like setting poly types etc.
  141.  
  142. Poly Types
  143. Normal
  144. ItemImpassable
  145. MonsterImpassable
  146. MinorDamage
  147. MajorDamage
  148. LightOnTrigger
  149. PlatformOnTrigger
  150. LightOffTrigger
  151. PlatformOffTrigger
  152. Platform
  153. Teleporter
  154. GlueTriggerSuperGlue
  155. Glue
  156. MustExplore
  157. Exit
  158.  
  159. Control Panel Types
  160. Oxygen
  161. Recharge1
  162. Recharge2
  163. Recharge3
  164. LightSwitch
  165. PlatformSwitch
  166. PatternBuffer
  167. Terminal
  168. RepairSwitch
  169. AlienRecharge2
  170. AlienRecharge3
  171. AlienPlatformSwitch
  172. AlienPatternBuffer
  173.  
  174.